package com.guohe3.just.controller;

import com.guohe3.just.common.resp.ApiResult;
import com.guohe3.just.common.utils.RestUtil;
import com.guohe3.just.service.SchoolInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author 浦希成
 * 2018-12-31
 */
@Api("获取江科大信息的接口")
@RequestMapping("api/justInfo")
@RestController
public class JUSTInfoController {
    @Autowired
    private SchoolInfoService schoolInfoService;

    @PostMapping("/getSchoolCalendar")
    @ApiOperation("获取校历信息")
    public ApiResult create(@RequestParam String username, @RequestParam String password) throws Exception {

        return RestUtil.success("查询成功", schoolInfoService.getSchoolCalendar(username, password));
    }
}

